from buyer import views
from django.urls import path, include

urlpatterns = [
    # path('register/', views.register),
    path('register/', views.Regiter.as_view()),
    path('login/', views.login),
    path('register_ajax/', views.register_ajax),
    path('index/', views.index),
    path('logout/', views.logout),
    path('goods_detail/', views.goods_detail),
    path('shopping_car_list/', views.shopping_car_list),  # 购物车
    path('my_orders/', views.my_orders),  # 我的订单
    path('user_info_center/', views.user_info_center),  # 用户中心
    path('more_list_v3/', views.more_list_v3),  # 查看更多
    path('shopping_car_add/', views.shopping_car_add),  # 加入购物车
    path('add_car_num/', views.add_car_num),  #  购物车增加数量
    path('reduce_car_num/', views.reduce_car_num),  #  购物车减少数量
    path('shopping_car_delete/', views.shopping_car_delete),  #  购物车商品删除
    path('orders_list/', views.orders_list),  #  结算
    path('buyer_address_add/', views.buyer_address_add),  #  结算
    path('change_address_status/', views.change_address_status),  #  修改状态
    path('now_buy/', views.now_buy),  #  立即购买
    # path('zfbcs/', views.zfbcs),  #  立即购买
    path('zfb/', views.zfb),  #  支付宝
    path('update_orders_status/', views.update_orders_status),  #  支付成功 修改状态

]
from rest_framework import routers
# 文档默认方式 此种方式不易区分
route = routers.DefaultRouter()
route.register(r'user', views.GoodsViewset, basename='')
urlpatterns += [
    path('ajax_more_goods_list_data/', views.ajax_more_goods_list_data),
    path('CBVtest/', views.CBVtest.as_view()),  #
    path('goodsapiview/', views.GoodsAPIView.as_view()),  ## ##
    path('goodsgenericview/', views.GoodsGenericView.as_view()),  ####
    path('goodslistapiview/', views.GoodsListAPIView.as_view()),  ####
    path('goodslistapiviewajax/', views.GoodsListAPIViewAJAX.as_view()), # 第三种方式
    path('goodsviewset/', views.GoodsViewset.as_view({'get': 'list', 'post': 'create'})), # 第四种方式
    path('', include(route.urls))
]
